import { Tool } from '../../../Tool';

/**
 * 旋转工具
 */
export class RotateTool extends Tool {
	constructor(viewer) {
		super(arguments);
		this.viewer = viewer;
		this.controller = viewer.scene.screenSpaceCameraController;
	}

	start() {
		this.controller.tiltEventTypes = [Cesium.CameraEventType.LEFT_DRAG];
	}

	cancel() {
		this.controller.tiltEventTypes = [
			Cesium.CameraEventType.MIDDLE_DRAG,
			Cesium.CameraEventType.RIGHT_DRAG
		];
	}
}
RotateTool.toolId = 'RotateTool';
